package com.huage.courseplatform.application.model.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="教师参数",description="教师参数")
public class TeacherManagePARAM implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "id不能为空", groups = Update.class)
    @ApiModelProperty(value = "id(更新可以不传)",required = true)
    private String id;

    @NotEmpty(message = "名字", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "教师名",required = true)
    private String name;

    @NotEmpty(message = "性别", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "性别",required = true)
    private String sex;

    @Email(message = "请输入正确的邮箱", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "邮箱")
    private String email;

    @Length(max = 11, min = 11,message = "请输入正确的手机号", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "教师头像ID")
    private String logoImg;


    @ApiModelProperty(value = "文化程度")
    private String degree;

    @ApiModelProperty(value = "身高(cm)")
    private Double height;

    @ApiModelProperty(value = "体重(kg)")
    private Double weight;

    @Past(message = "出生时间,不得晚于当前时间",groups = {Update.class, Insert.class})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @ApiModelProperty(value = "出生时间")
    private String birthday;

    @ApiModelProperty(value = "教师简介")
    private String description;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态 0：注销，1：正常使用，2：封禁，3：审核中")
    private Integer status;

}
